var djtimer1;
var djtimer2;
var djtimer3;
var dj1sp = 10;
var dj2sp = -10;
var dj3sp = 10;

function djs1(){
	dfj1.gotoAndPlay("dj");
	dfj1.x=Math.random()*350;
	dfj1.y=-200;
	clearInterval(djtimer1);
	djtimer1 = setInterval(function () {
	    if (dfj1.y < 800) {
	        dfj1.y = dfj1.y + 10;

	        dfj1.x = dfj1.x + dj1sp;
	    if (dfj1.x < -30) { dj1sp = Math.random() * 15; }
	    if (dfj1.x > 350) { dj1sp = Math.random() * -15; }
         }
	    else {
	        dfj1.x = Math.random() * 350;
	        dfj1.y = -200;
	        dfj1.gotoAndPlay("dj");
	    };

	}, djspeed2)
myStage.addChild(dfj1);
}

function djs2(){
	dfj2.gotoAndPlay("dj");
	dfj2.x=Math.random()*350;
	dfj2.y=-200;
	clearInterval(djtimer2);
	djtimer2=setInterval(function(){
	    if (dfj2.y < 800) {
	        dfj2.y = dfj2.y + 10;

	        dfj2.x = dfj2.x + dj2sp;
	        if (dfj2.x < -30) { dj2sp = Math.random() * 15; }
	        if (dfj2.x > 350) { dj2sp = Math.random() * -15; }
        }
		else{
		dfj2.x=Math.random()*350;
		dfj2.y=-200;
		dfj2.gotoAndPlay("dj");
		};
		},djspeed2)
myStage.addChild(dfj2);
}

function djs3(){
	dfj3.gotoAndPlay("dj");
	dfj3.x=Math.random()*350;
	dfj3.y=-200;
	clearInterval(djtimer3);
	djtimer3=setInterval(function(){
	    if (dfj3.y < 800) {
	        dfj3.y = dfj3.y + 10;

	        dfj3.x = dfj3.x + dj3sp;
	        if (dfj3.x < -30) { dj3sp = Math.random() * 15; }
	        if (dfj3.x > 350) { dj3sp = Math.random() * -15; } 
	    }
		else{
		dfj3.x=Math.random()*350;
		dfj3.y=-200;
		dfj3.gotoAndPlay("dj");
		};
		},djspeed2)
myStage.addChild(dfj3);
}


function dfjdie(){
	//fj1
	if(dfj1.x-ozd1.x>-90&&dfj1.x-ozd1.x<30&&dfj1.y-ozd1.y>-60&&dfj1.y-ozd1.y<40)
	{
		boos();
		dfj1.gotoAndPlay("dfjboo");
		myStage.removeChild(ozd1);
		ozd1.y=999;
		ozd1.x=999;
		z1=false;
		setTimeout(function(){djs1()},200);
		num=num+100;
		FS=num;
		}
	if(dfj1.x-ozd2.x>-90&&dfj1.x-ozd2.x<30&&dfj1.y-ozd2.y>-60&&dfj1.y-ozd2.y<40)
	{
		boos();
		dfj1.gotoAndPlay("dfjboo");
		myStage.removeChild(ozd2);
		setTimeout(function(){djs1()},200);
		ozd2.y=999;
		ozd2.x=999;
		z2=false;
		num=num+100;
		FS=num;
		}
	if(dfj1.x-ozd3.x>-90&&dfj1.x-ozd3.x<30&&dfj1.y-ozd3.y>-60&&dfj1.y-ozd3.y<40)
	{
		boos();
		dfj1.gotoAndPlay("dfjboo");
		myStage.removeChild(ozd3);
		setTimeout(function(){djs1()},200);
		ozd3.y=999;
		ozd3.x=999;
		z3=false;
		num=num+100;
		FS=num;
		}
	//fj2
	if(dfj2.x-ozd1.x>-90&&dfj2.x-ozd1.x<30&&dfj2.y-ozd1.y>-60&&dfj2.y-ozd1.y<40)
	{
		boos();
		dfj2.gotoAndPlay("dfjboo");
		myStage.removeChild(ozd1);
		setTimeout(function(){djs2()},200);
		ozd1.y=999;
		ozd1.x=999;
		z1=false;
		num=num+100;
		FS=num;
		}
	if(dfj2.x-ozd2.x>-90&&dfj2.x-ozd2.x<30&&dfj2.y-ozd2.y>-60&&dfj2.y-ozd2.y<40)
	{
		boos();
		dfj2.gotoAndPlay("dfjboo");
		myStage.removeChild(ozd2);
		setTimeout(function(){djs2()},200);
		ozd2.y=999;
		ozd2.x=999;
		z2=false;
		num=num+100;
		FS=num;
		}
	if(dfj2.x-ozd3.x>-90&&dfj2.x-ozd3.x<30&&dfj2.y-ozd3.y>-60&&dfj2.y-ozd3.y<40)
	{
		boos();
		dfj2.gotoAndPlay("dfjboo");
		myStage.removeChild(ozd3);
		setTimeout(function(){djs2()},200);
		ozd3.y=999;
		ozd3.x=999;
		z3=false;
		num=num+100;
		FS=num;
		}
	//fj3
	if(dfj3.x-ozd1.x>-90&&dfj3.x-ozd1.x<30&&dfj3.y-ozd1.y>-60&&dfj3.y-ozd1.y<40)
	{
		boos();
		dfj3.gotoAndPlay("dfjboo");
		myStage.removeChild(ozd1);
		setTimeout(function(){djs3()},200);
		ozd1.y=999;
		ozd1.x=999;
		z1=false;
		num=num+100;
		FS=num;
		}
	if(dfj3.x-ozd2.x>-90&&dfj3.x-ozd2.x<30&&dfj3.y-ozd2.y>-60&&dfj3.y-ozd2.y<40)
	{
		boos();
		dfj3.gotoAndPlay("dfjboo");
		myStage.removeChild(ozd2);
		setTimeout(function(){djs3()},200);
		ozd2.y=999;
		ozd2.x=999;
		z2=false;
		num=num+100;
		FS=num;
		}
	if(dfj3.x-ozd3.x>-90&&dfj3.x-ozd3.x<30&&dfj3.y-ozd3.y>-60&&dfj3.y-ozd3.y<40)
	{
		boos();
		dfj3.gotoAndPlay("dfjboo");
		myStage.removeChild(ozd3);
		setTimeout(function(){djs3()},200);
		ozd3.y=999;
		ozd3.x=999;
		z3=false;
		num=num+100;
		FS=num;
		}
		
	
	
	}